<?php
namespace App\Models\system;

use App\Models\Models;
use App\Models\traits\Query;
use Illuminate\Database\Eloquent\SoftDeletes;


class SystemAdminModel extends Models{

	use SoftDeletes, Query;
    protected $dates   = ['deleted_at'];

    protected $table = 'system_admin';

    protected $guarded = [];

    protected $role = ["未知", "超级管理员", "副管理员", "代理商"];

    // 获取器        get+字段名+Attribute($value)
    /*public function getCreatedAtAttribute($value) {
        return date('Y年m月d日 H时i分s秒', strtotime($value));
    }*/


    public function  getExpirationTimeAttribute($value){
        if($value){
            return date('Y-m-d H:i:s', $value);
        }else{
            return '永久';
        }
    }



    // 属于关系
//     public function role() {
//         return $this->belongsTo(Role::class,'role_id')->select('id','role_name');
//     }





}














































